let userDao  = require('../dao/userDao');

//业务逻辑方法
module.exports={
    //登录
    async login(username,pwd){
        let result = await userDao.getUserByusernameAndpwd(username,pwd)
        return result;
    },
    //注册
    async enroll(username,pwd){
        let result = await userDao.getusername(username);
        if(result!=null){
            return null;
        }else{
        let insertResult = await userDao.addUser(username,pwd);
         return insertResult
        }

    }
}